package kr.hkit.powerjava.chapter12.poly;

abstract class TwoDimshape extends Shape {
	abstract public void getArea();
	
}// end of TwoDimShape
class Ellipse extends TwoDimshape {
	double PI = 3.141592;
	int radius;
	double area;
	
	public Ellipse(int radius) {
		this.radius = radius;
	}
	
	public void getArea(){
		 System.out.println("원의 면적은 : " + (area = (radius * radius * PI)));
	}
}// end of Ellipse Class
class Rectangle extends TwoDimshape{
	double area;
	int length;
	int height;

	public Rectangle(int length, int height) {
		this.length = length;
		this.height = height;
	}

	public void getArea(){
		 System.out.println("사각형의 면적은 : " + (area = length * height));
	}
}// end of Rectangle Class
class Triangle extends TwoDimshape{
	double area;
	int length;
	int height;
	
	public Triangle(int length, int height) {
		this.length = length;
		this.height = height;
	}

	public void getArea(){
		System.out.println("삼각형의 면적은 : " + (area = (length * height )/2));
	}
}// end of Triangle Class